import React from 'react'
import { Route, IndexRoute } from 'react-router'
import App from './containers/App'
import Login from './pages/login'

const test11 = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/test/test1').default)
    }, 'test1')
}

const test22 = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/test/test2').default)
    }, 'test2')
}
const test33 = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/test/example').default)
    }, 'example')
}

const mainpage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/main').default)
    }, 'main')
}

const msgpage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/msg').default)
    }, 'msg')
}

const msgdetailpage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/msgDetail').default)
    }, 'msgDetail')
}

const appmain = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage').default)
    }, 'appPage')
}

const tenant = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant').default)
    }, 'tenant')
}

const mine = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine').default)
    }, 'mine')
}

const smartdr = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/smartDr').default)
    }, 'smartDr')
}
const appFirstPage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appFirstPage').default)
    }, 'appFirstPage')
}

const opensmartdr = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/openSmartdr').default)
    }, 'openSmartdr')
}

const wxmtsetinfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxmt/wxmtSetInfo').default)
    }, 'wxmtSetInfo')
}
const wxmtputlist = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxmt/wxmtPutList').default)
    }, 'wxmtPutList')
}
const wxmtputinfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxmt/wxmtPutInfo').default)
    }, 'wxmtPutinfo')
}
const openMT = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxmt/wxmtconfig').default)
    }, 'openMT')
}
const selectgroup = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./components/SelectGroup').default)
    }, 'SelectGroup')
}

const selectdr = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./components/SelectDr').default)
    }, 'SelectDr')
}

const aotenant = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/alreadyOpenTenant').default)
    }, 'alreadyOpenTenant')
}
storedetail
const groupdetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/groupDetail').default)
    }, 'groupDetail')
}
const storedetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/storedetail').default)
    }, 'storeDetail')
}
const tenantBind = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/tenantBind').default)
    }, 'tenantBind')
}
const tenantPush = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/tenantPush').default)
    }, 'tenantPush')
}
const storePush = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/storePush').default)
    }, 'storePush')
}
const storeBind = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/storeBind').default)
    }, 'storeBind')
}
const alreadybizdetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/tenant/alreadybizDetail').default)
    }, 'alreadybizDetail')
}

const setpage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/setPage').default)
    }, 'setPage')
}
//员工管理页面
const stuffmanage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/stuffManage').default)
    }, 'stuffManage')
}
//新增员工页面
const newmanage = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/newStuff').default)
    }, 'newStuff')
}
//我的业务申请页面
const mybizapply = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/myBizApply').default)
    }, 'myBizApply')
}
//业务申请详情页面
const applydetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/applyDetail').default)
    }, 'applyDetail')
}
//我的账户页面
const myacconut = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/myAccount').default)
    }, 'myAccount')
}
//修改账户信息详细内容页面
const modifydetail = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/modifyDetail').default)
    }, 'myAccount')
}
//公司信息
const companyinfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/mine/companyInfo').default)
    }, 'companyInfo')
}
//购物车

const shopcar = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/shopCar/shopCar').default)
    }, 'shopCar')
}

//【吾享】点餐设置
const wxDcConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/dcConfig').default)
    }, 'dcConfig')
}
//【吾享】开通饿了吗
const wxOpenElm = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxelm/openElm').default)
    }, 'openElm')
}
//【吾享】饿了吗门店配置
const wxMdConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxelm/mdConfig').default)
    }, 'mdConfig')
}
//【吾享】饿了吗已开通商户
const wxAlreadyOpenTenant = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxelm/alreadyOpenTenant').default)
    }, 'alreadyOpenTenant')
}
//【吾享】饿了吗外卖配置
const wxWmConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxelm/wmConfig').default)
    }, 'wmConfig')
}

//【吾享】开通餐道外卖
const wxcdOpen = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxcdwm/cdOpen').default)
    }, 'cdOpen')
}
//【吾享】餐道外卖门店配置
const wxcdMdConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxcdwm/cdMdConfig').default)
    }, 'cdMdConfig')
}
//【吾享】餐道外卖已开通商户
const wxcdAOpen = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxcdwm/cdAOpen').default)
    }, 'cdAOpen')
}
//【吾享】餐道外卖已开通门店配置
const wxcdAOpenMdConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxcdwm/cdAOpenMdConfig').default)
    }, 'cdAOpenMdConfig')
}

//【吾享】餐道外卖已开通集团配置
const wxcdAOpenJtConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/wxcdwm/cdAOpenJtConfig').default)
    }, 'cdAOpenJtConfig')
}

//【吾享】智慧餐厅已开通业务详情
const subProductInfo = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/subProductInfo').default)
    }, 'subProductInfo')
}
//【吾享】智慧餐厅外送设置
const wxWsConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/wsConfig').default)
    }, 'wsConfig')
}
//【吾享】智慧餐厅预定设置
const wxYdConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/ydConfig').default)
    }, 'ydConfig')
}
//【吾享】智慧餐厅外送时间设置
const wxWsConfigTime = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/wsConfigTime').default)
    }, 'wxWsConfigTime')
}
//【吾享】智慧餐厅批量设置
const batchConfig = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/batchConfig').default)
    }, 'batchConfig')
}
//【吾享】智慧餐厅续费页面
const renew = (location, cb) => {
    require.ensure([], require => {
        cb(null, require('./pages/appPage/smartdr/renew').default)
    }, 'renew')
}
const routes = (
    <Route path="/" component={App}>
        <IndexRoute component={Login} />
        <Route path="/test1" getComponent={test11} />
        <Route path="/test2" getComponent={test22} />
        <Route path="/example" getComponent={test33} />
        <Route path="/main" getComponent={mainpage} />
        <Route path="/message" getComponent={msgpage} />
        <Route path="/msgdetail(/:type)" getComponent={msgdetailpage} />
        <Route path="/appPage" getComponent={appmain} />
        <Route path="/tenant" getComponent={tenant} />
        <Route path="/mine" getComponent={mine} />
        <Route path="/shopCar" getComponent={shopcar} />
        {/*【吾享】智慧餐厅开始*/}
        <Route path="/smartDr" getComponent={smartdr} />
        <Route path="/appFirstPage(/:type)" getComponent={appFirstPage} />
        <Route path="/openSmartdr" getComponent={opensmartdr} />
        <Route path="/SelectGroup" getComponent={selectgroup} />
        <Route path="/SelectDr" getComponent={selectdr} />
        <Route path="/subProductInfo(/:storeCode)" getComponent={subProductInfo} />
        <Route path="/batchConfig" getComponent={batchConfig} />
        <Route path="/renew" getComponent={renew} />
        {/*【吾享】智慧餐厅结束*/}
        {/* 【吾享】饿了吗 */}
        <Route path="/openElm" getComponent={wxOpenElm} />
        <Route path="/mdConfig" getComponent={wxMdConfig} />
        <Route path="/alreadyOpenTenant" getComponent={wxAlreadyOpenTenant} />
        <Route path="/wmConfig" getComponent={wxWmConfig} />
        {/* 【吾享】饿了吗 */}
        {/*【吾享】美团*/}openMT
        <Route path="/openMT" getComponent={openMT} />
        <Route path="/wxmtSetInfo" getComponent={wxmtsetinfo} />wxmtputinfo
        <Route path="/wxmtPutList" getComponent={wxmtputlist} />
        <Route path="/wxmtPutInfo" getComponent={wxmtputinfo} />
        {/*【吾享】美团*/}
        {/*【吾享】餐道外卖*/}
        <Route path="/cdOpen" getComponent={wxcdOpen} />
        <Route path="/cdMdConfig" getComponent={wxcdMdConfig} />
        <Route path="/cdAOpen" getComponent={wxcdAOpen} />
        <Route path="/cdAOpenMdConfig" getComponent={wxcdAOpenMdConfig} />
        <Route path="/cdAOpenJtConfig" getComponent={wxcdAOpenJtConfig} />
        {/*【吾享】餐道外卖*/}
        <Route path="/AoTenant" getComponent={aotenant} />
        <Route path="/groupDetail(/:type)" getComponent={groupdetail} />
        <Route path="/storeDetail(/:type)" getComponent={storedetail} />
        <Route path="/tenantPush" getComponent={tenantPush} />
        <Route path="/storePush" getComponent={storePush} />
        <Route path="/storeBind" getComponent={storeBind} />
        <Route path="/tenantBind" getComponent={tenantBind} />
        <Route path="/abDetail(/:type)" getComponent={alreadybizdetail} />
        <Route path="/setPage" getComponent={setpage} />
        <Route path="/stuffManage" getComponent={stuffmanage} />
        <Route path="/newStuff" getComponent={newmanage} />
        <Route path="/myBizApply" getComponent={mybizapply} />
        <Route path="/applyDetail(/:type)" getComponent={applydetail} />
        <Route path="/myAccount" getComponent={myacconut} />
        <Route path="/modifyDetail(/:type)" getComponent={modifydetail} />
        <Route path="/companyInfo" getComponent={companyinfo} />
        <Route path="/wxDcConfig(/:storeCode)" getComponent={wxDcConfig} />
        <Route path="/wxWsConfig(/:storeCode)" getComponent={wxWsConfig} />
        <Route path="/wxYdConfig(/:storeCode)" getComponent={wxYdConfig} />
        <Route path="/wxWsConfigTime" getComponent={wxWsConfigTime} />
    </Route>
);

export default routes;